﻿<Window x:Class="AttendanceAccounting.Windows.Students"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:AttendanceAccounting.Windows"
        mc:Ignorable="d"
        Title="Студенты" Height="500" Width="800"
        MinHeight="500" MinWidth="800"
        MaxHeight="500" MaxWidth="800">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="225"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <GroupBox x:Name="GroupHeader"
                  Header="Добавление нового студента">
            <StackPanel>
                <Label Content="Фамилия"/>
                <TextBox Margin="5" x:Name="student_lastname">
                    <TextBox.Resources>
                        <Style TargetType="Border">
                            <Setter Property="CornerRadius" Value="12"/>
                        </Style>
                    </TextBox.Resources>
                </TextBox>
                <Label Content="Имя"/>
                <TextBox Margin="5" x:Name="student_firstname">
                    <TextBox.Resources>
                        <Style TargetType="Border">
                            <Setter Property="CornerRadius" Value="12"/>
                        </Style>
                    </TextBox.Resources>
                </TextBox>
                <Label Content="Отчество"/>
                <TextBox Margin="5" x:Name="student_patronymic">
                    <TextBox.Resources>
                        <Style TargetType="Border">
                            <Setter Property="CornerRadius" Value="12"/>
                        </Style>
                    </TextBox.Resources>
                </TextBox>
                <Button Height="24" Width="150" HorizontalAlignment="Right" Margin="5" Content="Добавить студента" x:Name="addStudent" Click="AddStudent_Click">
                    <Button.Resources>
                        <Style TargetType="Border">
                            <Setter Property="CornerRadius" Value="12"/>
                        </Style>
                    </Button.Resources>
                </Button>
            </StackPanel>
        </GroupBox>
        <StackPanel Grid.Column="1"
                    x:Name="DataStudent">
            <GroupBox 
                      Header="Список студентов">
                <ListBox x:Name="listStudents" 
                    ItemsSource="{Binding}"
                         Height="260"
                         SelectionChanged="listStudents_SelectionChanged"
                         ContextMenuOpening="ContextMenu_ContextMenuOpening">
                    <ListBox.ContextMenu>
                        <ContextMenu>
                            <MenuItem x:Name="EditRow"
                                      Header="Изменить строку"
                                      Click="EditRow_Click"/>
                        </ContextMenu>
                    </ListBox.ContextMenu>
                </ListBox>
            </GroupBox>
            <TextBlock Text="{Binding StringFormat=Количество строк {0}, 
    ElementName=listStudents, Path=Items.Count}"/>
            <GroupBox Header="Информация о студенте">
                <StackPanel>
                    <Label Content="Фамилия"/>
                    <TextBlock x:Name="infoLastName"/>

                    <Label Content="Имя"/>
                    <TextBlock x:Name="infoFirstName"/>

                    <Label Content="Отчество"/>
                    <TextBlock x:Name="infoPatronymic"/>
                </StackPanel>
            </GroupBox>
        </StackPanel>
    </Grid>
</Window>
